<template>
  <div class="return">
    <van-list v-model="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
      <div class="return-item" v-for="(item,index) in list" :key="index">
        <div class="return-item-top">
          <p class="return-job-name">{{item.gwmc}}</p>
          <div class="return-job-msg">
            <span class="msg-count">
              招聘人数
              <b>{{item.zrs}}人</b>
            </span>
            <span class="msg-form">
              用工形式
              <b>{{item.ygxs}}</b>
            </span>
          </div>
        </div>
        <div class="return-item-bottom">
          <div class="bottom-item">
            <span>发布时间</span>
            <p>{{item.fbsj}}</p>
          </div>
          <div class="bottom-item">
            <span>退回时间</span>
            <p>{{item.thsj}}</p>
          </div>
          <div class="bottom-item">
            <span>退回原因</span>
            <p>{{item.shbtgyy}}</p>
          </div>
          <div class="bottom-item">
            <span>退回机构</span>
            <p>{{item.thjg}}</p>
          </div>
        </div>
      </div>
    </van-list>
  </div>
</template>

<script>
import vocationList from "base/vocationList/vocationList";
export default {
  components: { vocationList },
  data() {
    return {
      pageNum: 1,
      pageSize: 10,
      list: [],
      loading: false,
      finished: false,
      visibleSlide: false
    };
  },
  methods: {
    onLoad() {
      // 异步更新数据
      this.$http({
        url: "/dwgl/zplbCx",
        method: "get",
        params: {
          pageNum: this.pageNum,
          pageSize: this.pageSize,
          czlx: 3
        }
      }).then(res => {
        // 加载状态结束
        this.loading = false;
        this.finished = false;

        let data = res.returnData;
        if (+data.executeResult == 1) {
          this.pageNum++;
          this.list.push(...data.zplb);
          if (this.pageNum > res.pageCount) {
            // 数据加载完毕
            this.finished = true;
          }
        } else {
          this.finished = true;
          return false;
        }
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.return {
  .return-item {
    padding: 33px 32px;
    background-color: #ffffff;
    box-sizing: border-box;
    border-radius: 6px;
    margin-top: 21px;
  }
  .return-item-top {
    border-bottom: 1px solid #dbdbdb;
    .return-job-name {
      color: #333333;
      font-size: 32px;
      font-weight: bold;
      margin-bottom: 20px;
    }
    .return-job-msg {
      display: flex;
      justify-content: space-between;
      align-items: center;
      color: #666666;
      font-size: 28px;
      margin-bottom: 28px;
      .msg-count,
      .msg-form {
        flex: 0 0 auto;
        b {
          margin-left: 10px;
          font-weight: normal;
        }
      }
    }
  }
  .return-item-bottom {
    .bottom-item {
      color: #666666;
      font-size: 28px;
      display: flex;
      margin-top: 20px;
      line-height: 38px;
      span {
        width: 140px;
      }
      p {
        flex: 1;
      }
    }
  }
}
</style>
